package com.zking.web.LYK;


import com.zking.dao.domain.Department;
import com.zking.dao.domain.Doctor;
import com.zking.dao.domain.Patient;
import com.zking.service.AsDoctorService;
import com.zking.service.KeshiService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;


import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
public class KeshiController {

    @Autowired
    KeshiService keshiService;

    @Autowired
    AsDoctorService asDoctorService;

    @RequestMapping("/keshi")
    public String toKeshi(Model model){
        List<Department> departments =keshiService.queryKeshi();
        model.addAttribute("departments",departments);
        System.out.println(departments);
        return "Front_page/keshi";
    }

    @RequestMapping("/toIndex")
    public String toIndex(Model model ){

        List<Doctor> doctors = keshiService.queryDoctors();

        model.addAttribute("doctors",doctors);

        List<Department> departments = keshiService.queryDepts();
        model.addAttribute("departments",departments);





        return "Front_page/index";

    }



    @RequestMapping("/lyktest")
    public String test(Model model){
        model.addAttribute("msg",1);
        return "Front_page/test";
    }
}
